scheduler: Update vcpu_schedule_lock to check for changed lock pointer as well
authorKeir Fraser <keir@xen.org>
Fri, 24 Dec 2010 08:26:29 +0000 (08:26 +0000)
committerKeir Fraser <keir@xen.org>
Fri, 24 Dec 2010 08:26:29 +0000 (08:26 +0000)
commit188be59890f39c0af54367e28cd0a80b80343b55
tree7de50972f4003d349656b4ecdb93ca2df01910df
parent71ac759b144fc0344f08f6c1c335ee53c5516ce6
scheduler: Update vcpu_schedule_lock to check for changed lock pointer as well

Credit2 has different cpus share a lock; which means that as cpus are
added, and as they're moved between pools, the pointer to the
scheduler lock may also change as well.

Since we don't want to have to grab a lock before grabbing the per-cpu
scheduler lock, we use the lock itself to protect against the pointer
changing.

However, since it may change between reading and locking, after we
grab the lock we need to check to make sure it's still the right one.

Update the vcpu_schedule_lock() definition to reflect this: both
v->processor and that processor's schedule lock are liable to change;
check both after grabbing the lock, and release / re-acquire if
necessary.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
xen/include/xen/sched-if.h